import java.io.*;


public class FileHandling {
	public static String FiletoString(String Uri) throws java.io.IOException
	{
		byte[] buffer = new byte[(int) new File(Uri).length()];
		BufferedInputStream f=null;
		try
		{
			f=new BufferedInputStream(new FileInputStream(new File(Uri)));
			f.read(buffer);
		}
		finally
		{
			if(f!=null)
				try
				{
						f.close();
				}
				catch(IOException ignored)
				{
					
				}
		}
		return new String(buffer);
	}

	public static void StringtoFile(String uri, String out) {
		BufferedOutputStream bos=null;
		try{
			bos=new BufferedOutputStream(new FileOutputStream(new File(uri)));
			bos.write(out.getBytes());
			bos.close();
		}
		catch(IOException e)
		{
			
		}
	}
}
